package com.nsgf.library.data.api;

import com.nsgf.library.data.bean.ClockInBean;
import com.nsgf.library.data.bean.DisplacementBean;
import com.nsgf.library.data.bean.FacilityBean;
import com.nsgf.library.data.bean.LibraryInfo;
import com.nsgf.library.data.bean.MessageBean;
import com.nsgf.library.data.bean.MonitorBean;
import com.nsgf.library.data.bean.ProjectBean;
import com.nsgf.library.data.bean.RepairBean;
import com.nsgf.library.data.bean.TransfusionBean;
import com.nsgf.library.data.bean.UserDataBean;
import com.nsgf.library.data.bean.UserInfo;
import com.nsgf.library.data.bean.VideoListBean;
import com.nsgf.library.data.bean.WareHouseBean;
import com.nsgf.library.data.bean.WaterRecordsBean;
import com.nsgf.library.data.bean.WeatherBean;
import com.nsgf.library.data.bean.WeatherDetailBean;
import com.nsgf.library.data.bean.WorkOrderBean;
import com.nsgf.library.data.bean.WorkOrderDetailBean;
import com.nsgf.library.data.response.ResponseStatus;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Create by GC at 2024/9/23
 */
public interface AccountService {

//    @POST("app/mag/AccAdmin/doLogin")
//    Call<UserDataBean> login(@Body RequestBody body);

    @POST("app/mag/AccAdmin/doLogin")
    Observable<ResponseStatus<UserDataBean>> login(@Body RequestBody body);

    @POST("app/mag/AdminPassword/update")
    Observable<ResponseStatus<String>> updatePassWord(@Query("oldPwd") String oldPwd,
                                                      @Query("newPwd") String newPwd);

    @GET("app/home/projectInfo/detail")
    Observable<ResponseStatus<LibraryInfo>> getVersion(@Query("projectCode") String oldPwd,
                                                       @Query("code") String newPwd);

    @GET("app/mag/AccAdmin/getLoginInfo")
    Call<ResponseStatus<UserInfo>> getLoginInfo();

    @GET("app/mag/AccAdmin/getLoginInfo")
    Observable<ResponseStatus<UserInfo>> getNewLoginInfo();

    @GET("app/message/list")
    Call<MessageBean> getMessage(@Query("type") String type,
                                 @Query("search") String search,
                                 @Query("projectCode") String projectCode);

    @GET("app/warning/list")
    Call<MessageBean> getWarningMessage(@Query("warnType") String type,
                                        @Query("search") String search,
                                        @Query("projectCode") String projectCode);


    @GET("app/message/detail")
    Call<ResponseStatus<MessageBean.DataBean>> getMessageDetail(@Query("id") String id);

    @GET("app/warning/detail")
    Call<ResponseStatus<MessageBean.DataBean>> getWarningDetail(@Query("id") String id);

    @GET("app/message/unreadCount")
    Call<ResponseStatus<MessageBean.DataBean>> unreadCount(@Query("projectCode") String projectCode);

    @GET("app/warning/unreadCount")
    Call<ResponseStatus<MessageBean.DataBean>> unreadWarningCount(@Query("projectCode") String projectCode);

    @GET("app/message/clear")
    Call<ResponseStatus<String>> setClearMessage(@Query("type") String type, @Query("projectCode") String projectCode);

    @GET("app/warning/clear")
    Call<ResponseStatus<String>> setClearWarningMessage(@Query("type") String type, @Query("projectCode") String projectCode);


    @GET("app/attendance/sameDayClockInDetail")
    Call<ClockInBean> sameDayClockInDetail(@Query("projectCode") String projectCode);


    @GET("app/attendance/punchTheClock")
    Call<ResponseStatus<String>> punchTheClock(@Query("projectCode") String projectCode);


    @GET("app/attendance/summary")
    Call<ClockInBean> punchSummary(@Query("projectCode") String projectCode,
                                   @Query("yearMonth") String yearMonth);

    @GET("app/monitor/video/videoList")
    Call<ResponseStatus<List<ClockInBean.DataBean>>> videoList(@Query("projectCode") String projectCode,
                                                               @Query("videoName") String videoName);

    @GET("/app/monitor/video/videoInfo")
    Call<ResponseStatus<Object>> videoInfo(@Query("deviceCode") String deviceCode,
                                           @Query("channelId") String channelId,
                                           @Query("callingMode") String callingMode);


    @GET("/app/workOrder/list")
    Call<ResponseStatus<List<WorkOrderBean>>> workOrderList(@Query("projectCode") String projectCode,
                                                            @Query("isComplete") int isComplete,
                                                            @Query("workOrderSources") String workOrderSources,
                                                            @Query("startTime") String startTime,
                                                            @Query("endTime") String endTime,
                                                            @Query("search") String search,
                                                            @Query("patrolType") String patrolType);

    @GET("app/workOrder/patrolDetail")
    Call<WorkOrderDetailBean> patrolDetail(@Query("orderCode") String orderCode);

    @Multipart
    @POST("/app/mag/file/upload")
    Call<ResponseStatus<WorkOrderDetailBean.FileDto>> uploadFile(@Part MultipartBody.Part file);

//
//    @Multipart
//    @POST("/app/mag/file/upload")
//    Call<ResponseStatus<WorkOrderDetailBean.FileDto>> uploadFileList(@Part List<MultipartBody.Part> file);
//


    @POST("app/workOrder/handleWorkOrder")
    Call<ResponseStatus<String>> handleWorkOrder(@Body RequestBody body);

    @POST("app/workOrder/reviewWorkOrder")
    Call<ResponseStatus<String>> reviewWorkOrder(@Body RequestBody body);

    @GET("app/mag/smDict/getDictItems")
    Call<WeatherBean> getDictItems(@Query("dictId") String dictCode);

    @GET("app/home/statistics")
    Call<ClockInBean> getStatistics(@Query("projectCode") String projectCode);

    @GET("app/reservoir/reservoirInfo")
    Observable<ResponseStatus<ProjectBean>> reservoirInfo(@Query("projectCode") String projectCode);

    /**
     * 首页获取大坝巡查和经常检测
     *
     * @param patrolType
     * @return
     */
    @POST("app/workOrder/sameDayPatrolTask")
    Call<ResponseStatus<List<WorkOrderBean>>> sameDayPatrolTask(@Query("patrolType") String patrolType);


    /**
     * 区域矩阵视频监控
     *
     * @param videoName
     * @return
     */
    @GET("app/monitor/video/videoListMatrix")
    Observable<ResponseStatus<List<VideoListBean>>> getReginVideoList(@Query("videoName") String videoName);


    //大坝巡查动态统计
    @GET("app/patrol/order/damDynamicsStatistics")
    Observable<ResponseStatus<List<LibraryInfo>>> damDynamicsStatistics(@Query("startDate") String startDate, @Query("endDate") String endDate);


    /**
     * 巡查动态
     *
     * @param date
     * @return
     */
    @GET("app/patrol/order/damDailyDynamics")
    Observable<ResponseStatus<List<LibraryInfo>>> damDailyDynamics(@Query("date") String date);

    /**
     * 区域水情监测
     *
     * @param facilityCode
     * @param startTime
     * @param endTime
     * @return
     */
    @GET("app/monitor/regimenInfo")
    Observable<ResponseStatus<WaterRecordsBean>> regimenInfo(@Query("facilityCode") String facilityCode,
                                                             @Query("startTime") String startTime,
                                                             @Query("endTime") String endTime);

    /**
     * 区域水库搜索
     *
     * @param projectName
     * @return
     */
    @GET("app/workbench/getReservoirByName")
    Observable<ResponseStatus<List<UserInfo.ProjectListBean>>> getReservoirByName(@Query("projectName") String projectName);

    /**
     * 水库详情
     *
     * @param projectCode
     * @return
     */
    @GET("app/workbench/getPictureDetails")
    Observable<ResponseStatus<ProjectBean>> getPictureDetails(@Query("projectCode") String projectCode);


    /**
     * 区域雨量监测
     *
     * @param projectName
     * @return
     */
    @GET("app/monitor/rain/getRainfallList")
    Observable<ResponseStatus<List<LibraryInfo>>> getRainMonitoringList(@Query("projectName") String projectName);

    /**
     * 区域水情监测列表
     *
     * @param projectName
     * @return
     */
    @GET("app/monitor/water/getWaterLevelList")
    Observable<ResponseStatus<List<LibraryInfo>>> getWaterMonitoringList(@Query("projectName") String projectName);

    /**
     * 区域矩阵雨量详情
     *
     * @return
     */
    @POST("app/monitor/diagram")
    Observable<ResponseStatus<WaterRecordsBean>> getMonitorRainDetails(@Body RequestBody body);

    /**
     * 防汛仓库
     *
     * @param storeName 仓库名称
     * @return
     */
    @GET("app/business/store/getStore")
    Observable<ResponseStatus<List<WareHouseBean>>> getStore(@Query("storeName") String storeName);


    @GET("app/home/realTimeWorkConditions")
    Observable<ResponseStatus<List<LibraryInfo>>> realTimeWorkConditions(@Query("projectCode") String projectCode,
                                                                         @Query("gateType") String gateType);

    @GET("juzhen/business/taskPlan/list")
    Observable<ResponseStatus<LibraryInfo>> taskPlanListId(@Query("projectCode") String projectCode,
                                                           @Query("year") int year,
                                                           @Query("pageNum") int pageNum,
                                                           @Query("pageSize") int pageSize);

    @GET("juzhen//business/task/list")
    Observable<ResponseStatus<List<LibraryInfo>>> taskPlanList(@Query("month") String month,
                                                               @Query("week") String week,
                                                               @Query("planId") String planId,
                                                               @Query("workType") String workType,
                                                               @Query("isDetail") boolean isDetail);

    @GET("app/business/task/detail")
    Observable<ResponseStatus<LibraryInfo>> taskPlanDetail(@Query("id") String id);


    @GET("app/weather/queryWeatherForecast")
    Observable<ResponseStatus<WeatherDetailBean>> queryWeatherForecast();


    /**
     * 渗流监测
     * @return
     */
    @POST("app/monitor/seepageFlowList")
    Observable<ResponseStatus<TransfusionBean>> seepageFlowList(@Body RequestBody body);

    /**
     * 渗压监测
     * @return
     */
    @GET("app/monitor/getTransectName")
    Observable<ResponseStatus<List<String>>> getTransectName(@Query("projectCode") String projectCode);

    @GET("app/monitor/analysis")
    Observable<ResponseStatus<TransfusionBean>> analysis(@Query("projectCode") String projectCode,
                                                         @Query("transectName") String transectName,
                                                         @Query("startDate") String startDate,
                                                         @Query("endDate") String endDate);


    @POST("juzhen//business/repair/list")
    Observable<ResponseStatus<RepairBean>> getRepairList(@Body RequestBody body);

    @POST("juzhen//business/nurture/list")
    Observable<ResponseStatus<RepairBean>> getNurtureList(@Body RequestBody body);

    //维修详情
    @GET("juzhen/business/repair/getInfo")
    Observable<ResponseStatus<RepairBean>> getRepairInfo(@Query("id") String id);

    //养护详情
    @GET("juzhen/business/nurture/getInfo")
    Observable<ResponseStatus<RepairBean>> getNurtureInfo(@Query("id") String id);


    @GET("juzhen/business/register/list")
    Observable<ResponseStatus<LibraryInfo>> getRegisterInfo(@Query("projectCode") String projectCode,
                                                            @Query("pageNum") int pageNum,
                                                            @Query("pageSize") int pageSize);

    @GET("app/monitor/getSectionTm")
    Observable<ResponseStatus<MonitorBean>> getSectionTm(@Query("projectCode") String projectCode,
                                                         @Query("monitorObj") String monitorObj,
                                                         @Query("monitorType") String monitorType);

    @POST("app/monitor/getDisplacementDist")
    Observable<ResponseStatus<List<DisplacementBean>>> getDisplacementDist(@Body RequestBody body);


    @POST("app/monitor/getProcessLine")
    Observable<ResponseStatus<Object>> getProcessLine(@Body RequestBody body);


    @POST("app/monitor/getGNSSDisplacementDist")
    Observable<ResponseStatus<List<DisplacementBean>>> getGNSSDisplacementDist(@Body RequestBody body);

    @POST("app/monitor/getGNSSProcessLine")
    Observable<ResponseStatus<Object>> getGNSSProcessLine(@Body RequestBody body);

    /**
     * 创建工单
     * @param body
     * @return
     */
    @POST("app/workOrder/create")
    Observable<ResponseStatus<String>> setCreateWord(@Body RequestBody body);

    /**
     * 建筑物列表
     * @param projectCode
     * @return
     */
    @GET("app/api/facility/list")
    Observable<ResponseStatus<List<FacilityBean>>> facilityList(@Query("projectCode") String projectCode);

    @GET("app/api/facility/detail")
    Observable<ResponseStatus<FacilityBean>> facilityDetail(@Query("facilityCode") String facilityCode,
                                                            @Query("type") String type);

    @GET("app/workOrder/detail")
    Observable<ResponseStatus<WorkOrderBean>> workOrderDetail(@Query("id") String id,
                                                              @Query("type") String type);

}
